<include file='public/_meta'>

<div class="page-container">
	<form action="{:url('edit')}" method="post" class="form form-horizontal" id="form-type-add">
		<input type="hidden" name="id" value="{$data.id}">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">
				<span class="c-red">*</span>
				品牌名称：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<input type="text" class="input-text" value="{$data.name}" placeholder="" id="user-name" name="name">
			</div>
		</div>

		<div class="row cl">
			<a href="__UPLOADS__/{$data.logo}" target="_blank">{$data.logo}</a>
			
			<label class="form-label col-xs-4 col-sm-2">品牌logo：</label>
			<div class="formControls col-xs-6 col-sm-6"> <span class="btn-upload form-group">
				<input class="input-text upload-url" type="text" id="uploadfile" readonly nullmsg="请添加附件！" style="width:200px">
				<a href="javascript:void();" class="btn btn-primary radius upload-btn"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
				<input type="file" name="logo" class="input-file">
				</span> </div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">品牌描述：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<textarea name="desc" cols="" rows="" class="textarea"  dragonfly="true" onKeyUp="">{$data.desc}</textarea>
			</div>
		</div>

		<div class="row cl">
			<div class="col-9 col-offset-2">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;确认提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>

<!--_footer 作为公共模版分离出去-->
<include file='public/_footer'>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
$(function(){

	$("#form-type-add").validate({
		rules:{
			name:{
				required:true,
				maxlength:60
			},
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				 success: function(data) { 
				 	var index = parent.layer.getFrameIndex(window.name);
					//parent.$('.btn-refresh').click();
                if(data['status']==0){
                
                	layer.msg(data['msg'], {icon:6,time:1000},function(){

						parent.location.href = '{:url('index')}';              		
						// parent.layer.close(index);
                	});

                }else{
                	layer.msg(data['msg']);

                }
            }


			});

		}
	});
});

</script> 
<!--/请在上方写此页面业务相关的脚本-->